﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProtoBuf;
using System.Runtime.Serialization;

namespace SchemaMonitor.json
{
    [DataContract]
    public class CConnection
    {
        //Data
        [DataMember(Order = 1)] public readonly string Name;
        [DataMember(Order = 2)] public string Url { get; set; }

        //Constructors
        public CConnection(Dictionary<string, object> dict) : this(new CDict(dict)) { }
        public CConnection(CDict d)
        {
            Name = d.AsStr("name");
            Url = d.AsStr("url");
        }
        public CConnection(string name, string url)
        {
            Name = name;
            Url = url;
        }
        private CConnection() { }
        static CConnection() { Serializer.PrepareSerializer<CConnection>(); }
    }
}
